package com.taobao.pojo;

public class Page {

	private int currentPage;
	
	private int countPage;

	public Page(int currentPage, int countPage) {
		this.currentPage = currentPage;
		this.countPage = countPage;
	}

	public int getCurrentPage() {
		return currentPage;
	}

	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}

	public int getCountPage() {
		return countPage;
	}

	public void setCountPage(int countPage) {
		this.countPage = countPage;
	}
	
	public void nextPage(){
		setCurrentPage(getCurrentPage() >= getCountPage() ? getCountPage() : (getCurrentPage() + 1));
	}
	
	public void prePage(){
		setCurrentPage(getCurrentPage() <= 1 ? 1 : (getCurrentPage() - 1));
	}
	
	public boolean isLastPage(){
		return getCountPage() == getCurrentPage() ? true : false;
	}
}
